/**
 * 权限控制指令
 * <some-element v-premit-unuse="'auth_code'"></some-element>
 */
export default {
    bind: function(el, binding, vnode) {
        let store = vnode.context.$store;
        let path = vnode.context.$route.path;
        let auth_code = binding.value;
        if (!auth_code) {
            auth_code = binding.expression;
        }
        store.getters.getFuncUnderPage(path).then(funcs => {
            if (!funcs[auth_code]) {
                el.setAttribute("disabled", 'disabled');
                el.className += ' is-disabled';
               // el.disabled = true;
            }
        });
    }
}